Integrand size = 23, antiderivative size = 175 \[ \int \frac {c+d \tan (e+f x)}{(a+b \tan (e+f x))^3} \, dx=\frac {\left (a^3 c-3 a b^2 c+3 a^2 b d-b^3 d\right ) x}{\left (a^2+b^2\right )^3}+\frac {\left (3 a^2 b c-b^3 c-a^3 d+3 a b^2 d\right ) \log (a \cos (e+f x)+b \sin (e+f x))}{\left (a^2+b^2\right )^3 f}-\frac {b c-a d}{2 \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2}-\frac {2 a b c-a^2 d+b^2 d}{\left (a^2+b^2\right )^2 f (a+b \tan (e+f x))} \]
[Out]
Time = 0.32 (sec) , antiderivative size = 175, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3610, 3612, 3611} \[ \int \frac {c+d \tan (e+f x)}{(a+b \tan (e+f x))^3} \, dx=-\frac {b c-a d}{2 f \left (a^2+b^2\right ) (a+b \tan (e+f x))^2}-\frac {a^2 (-d)+2 a b c+b^2 d}{f \left (a^2+b^2\right )^2 (a+b \tan (e+f x))}+\frac {\left (a^3 (-d)+3 a^2 b c+3 a b^2 d-b^3 c\right ) \log (a \cos (e+f x)+b \sin (e+f x))}{f \left (a^2+b^2\right )^3}+\frac {x \left (a^3 c+3 a^2 b d-3 a b^2 c-b^3 d\right )}{\left (a^2+b^2\right )^3} \]
[In]
[Out]
Rule 3610
Rule 3611
Rule 3612
Rubi steps \begin{align*} \text {integral}& = -\frac {b c-a d}{2 \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2}+\frac {\int \frac {a c+b d-(b c-a d) \tan (e+f x)}{(a+b \tan (e+f x))^2} \, dx}{a^2+b^2} \\ & = -\frac {b c-a d}{2 \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2}-\frac {2 a b c-a^2 d+b^2 d}{\left (a^2+b^2\right )^2 f (a+b \tan (e+f x))}+\frac {\int \frac {a^2 c-b^2 c+2 a b d-\left (2 a b c-a^2 d+b^2 d\right ) \tan (e+f x)}{a+b \tan (e+f x)} \, dx}{\left (a^2+b^2\right )^2} \\ & = \frac {\left (a^3 c-3 a b^2 c+3 a^2 b d-b^3 d\right ) x}{\left (a^2+b^2\right )^3}-\frac {b c-a d}{2 \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2}-\frac {2 a b c-a^2 d+b^2 d}{\left (a^2+b^2\right )^2 f (a+b \tan (e+f x))}+\frac {\left (3 a^2 b c-b^3 c-a^3 d+3 a b^2 d\right ) \int \frac {b-a \tan (e+f x)}{a+b \tan (e+f x)} \, dx}{\left (a^2+b^2\right )^3} \\ & = \frac {\left (a^3 c-3 a b^2 c+3 a^2 b d-b^3 d\right ) x}{\left (a^2+b^2\right )^3}+\frac {\left (3 a^2 b c-b^3 c-a^3 d+3 a b^2 d\right ) \log (a \cos (e+f x)+b \sin (e+f x))}{\left (a^2+b^2\right )^3 f}-\frac {b c-a d}{2 \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2}-\frac {2 a b c-a^2 d+b^2 d}{\left (a^2+b^2\right )^2 f (a+b \tan (e+f x))} \\ \end{align*}
Result contains complex when optimal does not.
Time = 4.74 (sec) , antiderivative size = 243, normalized size of antiderivative = 1.39 \[ \int \frac {c+d \tan (e+f x)}{(a+b \tan (e+f x))^3} \, dx=-\frac {d \left (\frac {i \log (i-\tan (e+f x))}{(a+i b)^2}-\frac {i \log (i+\tan (e+f x))}{(a-i b)^2}+\frac {2 b \left (-2 a \log (a+b \tan (e+f x))+\frac {a^2+b^2}{a+b \tan (e+f x)}\right )}{\left (a^2+b^2\right )^2}\right )+(b c-a d) \left (\frac {i \log (i-\tan (e+f x))}{(a+i b)^3}-\frac {\log (i+\tan (e+f x))}{(i a+b)^3}+\frac {b \left (\left (-6 a^2+2 b^2\right ) \log (a+b \tan (e+f x))+\frac {\left (a^2+b^2\right ) \left (5 a^2+b^2+4 a b \tan (e+f x)\right )}{(a+b \tan (e+f x))^2}\right )}{\left (a^2+b^2\right )^3}\right )}{2 b f} \]
[In]
[Out]
Time = 0.38 (sec) , antiderivative size = 206, normalized size of antiderivative = 1.18
method | result | size |
derivativedivides | \(\frac {-\frac {\left (a^{3} d -3 a^{2} b c -3 a \,b^{2} d +b^{3} c \right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{3}}+\frac {a d -b c}{2 \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (f x +e \right )\right )^{2}}+\frac {a^{2} d -2 a b c -b^{2} d}{\left (a^{2}+b^{2}\right )^{2} \left (a +b \tan \left (f x +e \right )\right )}+\frac {\frac {\left (a^{3} d -3 a^{2} b c -3 a \,b^{2} d +b^{3} c \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a^{3} c +3 a^{2} b d -3 a \,b^{2} c -b^{3} d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{3}}}{f}\) | \(206\) |
default | \(\frac {-\frac {\left (a^{3} d -3 a^{2} b c -3 a \,b^{2} d +b^{3} c \right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{3}}+\frac {a d -b c}{2 \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (f x +e \right )\right )^{2}}+\frac {a^{2} d -2 a b c -b^{2} d}{\left (a^{2}+b^{2}\right )^{2} \left (a +b \tan \left (f x +e \right )\right )}+\frac {\frac {\left (a^{3} d -3 a^{2} b c -3 a \,b^{2} d +b^{3} c \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a^{3} c +3 a^{2} b d -3 a \,b^{2} c -b^{3} d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{3}}}{f}\) | \(206\) |
norman | \(\frac {\frac {\left (a^{3} c +3 a^{2} b d -3 a \,b^{2} c -b^{3} d \right ) a^{2} x}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) \left (a^{2}+b^{2}\right )}+\frac {b^{2} \left (a^{3} c +3 a^{2} b d -3 a \,b^{2} c -b^{3} d \right ) x \left (\tan ^{2}\left (f x +e \right )\right )}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) \left (a^{2}+b^{2}\right )}+\frac {2 a^{3} b d -3 a^{2} b^{2} c -b^{4} c}{2 b f \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}+\frac {b \left (-a^{2} b d +2 a \,b^{2} c +b^{3} d \right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2 f a \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}+\frac {2 b \left (a^{3} c +3 a^{2} b d -3 a \,b^{2} c -b^{3} d \right ) a x \tan \left (f x +e \right )}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) \left (a^{2}+b^{2}\right )}}{\left (a +b \tan \left (f x +e \right )\right )^{2}}+\frac {\left (a^{3} d -3 a^{2} b c -3 a \,b^{2} d +b^{3} c \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}-\frac {\left (a^{3} d -3 a^{2} b c -3 a \,b^{2} d +b^{3} c \right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}\) | \(435\) |
risch | \(\frac {i x d}{3 i a^{2} b -i b^{3}-a^{3}+3 a \,b^{2}}-\frac {x c}{3 i a^{2} b -i b^{3}-a^{3}+3 a \,b^{2}}+\frac {2 i a^{3} d x}{a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}}-\frac {6 i a^{2} b c x}{a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}}-\frac {6 i a \,b^{2} d x}{a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}}+\frac {2 i b^{3} c x}{a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}}+\frac {2 i a^{3} d e}{f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}-\frac {6 i a^{2} b c e}{f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}-\frac {6 i a \,b^{2} d e}{f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}+\frac {2 i b^{3} c e}{f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}-\frac {2 i \left (-i a^{2} b^{2} d \,{\mathrm e}^{2 i \left (f x +e \right )}+2 i a \,b^{3} c \,{\mathrm e}^{2 i \left (f x +e \right )}-b^{4} c \,{\mathrm e}^{2 i \left (f x +e \right )}+2 i a^{2} b^{2} d -3 i a \,b^{3} c -b^{3} d a +i b^{4} d \,{\mathrm e}^{2 i \left (f x +e \right )}+2 a^{3} b d \,{\mathrm e}^{2 i \left (f x +e \right )}-3 a^{2} b^{2} c \,{\mathrm e}^{2 i \left (f x +e \right )}-i b^{4} d +2 a^{3} b d -3 a^{2} b^{2} c \right )}{\left (i b +a \right )^{2} \left (-i {\mathrm e}^{2 i \left (f x +e \right )} b +{\mathrm e}^{2 i \left (f x +e \right )} a +i b +a \right )^{2} f \left (-i b +a \right )^{3}}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i b +a}{i b -a}\right ) a^{3} d}{f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}+\frac {3 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i b +a}{i b -a}\right ) a^{2} b c}{f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}+\frac {3 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i b +a}{i b -a}\right ) a \,b^{2} d}{f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i b +a}{i b -a}\right ) b^{3} c}{f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}\) | \(803\) |
parallelrisch | \(\text {Expression too large to display}\) | \(917\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 501 vs. \(2 (173) = 346\).
Time = 0.26 (sec) , antiderivative size = 501, normalized size of antiderivative = 2.86 \[ \int \frac {c+d \tan (e+f x)}{(a+b \tan (e+f x))^3} \, dx=\frac {2 \, {\left ({\left (a^{5} - 3 \, a^{3} b^{2}\right )} c + {\left (3 \, a^{4} b - a^{2} b^{3}\right )} d\right )} f x + {\left (2 \, {\left ({\left (a^{3} b^{2} - 3 \, a b^{4}\right )} c + {\left (3 \, a^{2} b^{3} - b^{5}\right )} d\right )} f x + {\left (5 \, a^{2} b^{3} - b^{5}\right )} c - 3 \, {\left (a^{3} b^{2} - a b^{4}\right )} d\right )} \tan \left (f x + e\right )^{2} - {\left (7 \, a^{2} b^{3} + b^{5}\right )} c + {\left (5 \, a^{3} b^{2} - a b^{4}\right )} d + {\left ({\left ({\left (3 \, a^{2} b^{3} - b^{5}\right )} c - {\left (a^{3} b^{2} - 3 \, a b^{4}\right )} d\right )} \tan \left (f x + e\right )^{2} + {\left (3 \, a^{4} b - a^{2} b^{3}\right )} c - {\left (a^{5} - 3 \, a^{3} b^{2}\right )} d + 2 \, {\left ({\left (3 \, a^{3} b^{2} - a b^{4}\right )} c - {\left (a^{4} b - 3 \, a^{2} b^{3}\right )} d\right )} \tan \left (f x + e\right )\right )} \log \left (\frac {b^{2} \tan \left (f x + e\right )^{2} + 2 \, a b \tan \left (f x + e\right ) + a^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) + 2 \, {\left (2 \, {\left ({\left (a^{4} b - 3 \, a^{2} b^{3}\right )} c + {\left (3 \, a^{3} b^{2} - a b^{4}\right )} d\right )} f x + 3 \, {\left (a^{3} b^{2} - a b^{4}\right )} c - {\left (2 \, a^{4} b - 3 \, a^{2} b^{3} + b^{5}\right )} d\right )} \tan \left (f x + e\right )}{2 \, {\left ({\left (a^{6} b^{2} + 3 \, a^{4} b^{4} + 3 \, a^{2} b^{6} + b^{8}\right )} f \tan \left (f x + e\right )^{2} + 2 \, {\left (a^{7} b + 3 \, a^{5} b^{3} + 3 \, a^{3} b^{5} + a b^{7}\right )} f \tan \left (f x + e\right ) + {\left (a^{8} + 3 \, a^{6} b^{2} + 3 \, a^{4} b^{4} + a^{2} b^{6}\right )} f\right )}} \]
[In]
[Out]
Exception generated. \[ \int \frac {c+d \tan (e+f x)}{(a+b \tan (e+f x))^3} \, dx=\text {Exception raised: AttributeError} \]
[In]
[Out]
none
Time = 0.40 (sec) , antiderivative size = 333, normalized size of antiderivative = 1.90 \[ \int \frac {c+d \tan (e+f x)}{(a+b \tan (e+f x))^3} \, dx=\frac {\frac {2 \, {\left ({\left (a^{3} - 3 \, a b^{2}\right )} c + {\left (3 \, a^{2} b - b^{3}\right )} d\right )} {\left (f x + e\right )}}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac {2 \, {\left ({\left (3 \, a^{2} b - b^{3}\right )} c - {\left (a^{3} - 3 \, a b^{2}\right )} d\right )} \log \left (b \tan \left (f x + e\right ) + a\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} - \frac {{\left ({\left (3 \, a^{2} b - b^{3}\right )} c - {\left (a^{3} - 3 \, a b^{2}\right )} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} - \frac {{\left (5 \, a^{2} b + b^{3}\right )} c - {\left (3 \, a^{3} - a b^{2}\right )} d + 2 \, {\left (2 \, a b^{2} c - {\left (a^{2} b - b^{3}\right )} d\right )} \tan \left (f x + e\right )}{a^{6} + 2 \, a^{4} b^{2} + a^{2} b^{4} + {\left (a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}\right )} \tan \left (f x + e\right )^{2} + 2 \, {\left (a^{5} b + 2 \, a^{3} b^{3} + a b^{5}\right )} \tan \left (f x + e\right )}}{2 \, f} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 413 vs. \(2 (173) = 346\).
Time = 0.53 (sec) , antiderivative size = 413, normalized size of antiderivative = 2.36 \[ \int \frac {c+d \tan (e+f x)}{(a+b \tan (e+f x))^3} \, dx=\frac {\frac {2 \, {\left (a^{3} c - 3 \, a b^{2} c + 3 \, a^{2} b d - b^{3} d\right )} {\left (f x + e\right )}}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} - \frac {{\left (3 \, a^{2} b c - b^{3} c - a^{3} d + 3 \, a b^{2} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac {2 \, {\left (3 \, a^{2} b^{2} c - b^{4} c - a^{3} b d + 3 \, a b^{3} d\right )} \log \left ({\left | b \tan \left (f x + e\right ) + a \right |}\right )}{a^{6} b + 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} + b^{7}} - \frac {9 \, a^{2} b^{3} c \tan \left (f x + e\right )^{2} - 3 \, b^{5} c \tan \left (f x + e\right )^{2} - 3 \, a^{3} b^{2} d \tan \left (f x + e\right )^{2} + 9 \, a b^{4} d \tan \left (f x + e\right )^{2} + 22 \, a^{3} b^{2} c \tan \left (f x + e\right ) - 2 \, a b^{4} c \tan \left (f x + e\right ) - 8 \, a^{4} b d \tan \left (f x + e\right ) + 18 \, a^{2} b^{3} d \tan \left (f x + e\right ) + 2 \, b^{5} d \tan \left (f x + e\right ) + 14 \, a^{4} b c + 3 \, a^{2} b^{3} c + b^{5} c - 6 \, a^{5} d + 7 \, a^{3} b^{2} d + a b^{4} d}{{\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} {\left (b \tan \left (f x + e\right ) + a\right )}^{2}}}{2 \, f} \]
[In]
[Out]
Time = 6.67 (sec) , antiderivative size = 279, normalized size of antiderivative = 1.59 \[ \int \frac {c+d \tan (e+f x)}{(a+b \tan (e+f x))^3} \, dx=-\frac {\ln \left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (\frac {a\,d-3\,b\,c}{{\left (a^2+b^2\right )}^2}-\frac {4\,b^2\,\left (a\,d-b\,c\right )}{{\left (a^2+b^2\right )}^3}\right )}{f}-\frac {\frac {-3\,d\,a^3+5\,c\,a^2\,b+d\,a\,b^2+c\,b^3}{2\,\left (a^4+2\,a^2\,b^2+b^4\right )}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (-d\,a^2\,b+2\,c\,a\,b^2+d\,b^3\right )}{a^4+2\,a^2\,b^2+b^4}}{f\,\left (a^2+2\,a\,b\,\mathrm {tan}\left (e+f\,x\right )+b^2\,{\mathrm {tan}\left (e+f\,x\right )}^2\right )}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-d+c\,1{}\mathrm {i}\right )}{2\,f\,\left (-a^3-a^2\,b\,3{}\mathrm {i}+3\,a\,b^2+b^3\,1{}\mathrm {i}\right )}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (c-d\,1{}\mathrm {i}\right )}{2\,f\,\left (-a^3\,1{}\mathrm {i}-3\,a^2\,b+a\,b^2\,3{}\mathrm {i}+b^3\right )} \]
[In]
[Out]